// src/main/decorator/ipc.decorator.ts
import { IpcRegistry } from '@main/decorator/registry'

export function IpcHandler(moduleName: string = '') {
  return function (target: any) {
    Reflect.defineMetadata('ipc:module', moduleName, target)
  }
}

export function IpcInvoke(methodKey: string) {
  return function (target: any, methodName: string, descriptor: PropertyDescriptor) {
    const constructor = target.constructor
    const registry = IpcRegistry.getInstance()
    registry.register(constructor, methodName, methodKey)
    return descriptor
  }
}
